extends Control

@onready var roundNum=$Round
@onready var time=$Time
@onready var timer=$Timer

signal roundEnd

var curRound=0:
    set(v):
        curRound=v
        roundNum.text="第%s波"%[str(v)]

var roundTime=0:
    set(v):
        roundTime=v
        time.text=str(v)

func _ready() -> void:
    initRound()

func initRound():
    curRound+=1
    roundTime=10*curRound
    timer.start()


func _on_timer_timeout() -> void:
    roundTime-=1
    if roundTime<=0:
        timer.stop()
        emit_signal('roundEnd',curRound)
